/* Function returns either 1 if rexxarplib is available or **
** 0 if it isn't. [RArp] and [ReqT] can be used later as the **
** condition in IF statements. */
DReq = 0
if CheckLib('rexxreqtools.library',32) then do
/* addlib() won't let us check for the decimal on a version **
** so this assures us that 37.50 is the minimum version used. */
RqLibVer = LibVer('rexxreqtools.library')
if RqLibVer >= 37.50 then
ReqT = 1
else do
ReqT = 0
call remlib('rexxreqtools.library')
if RqLibVer > -1 then
SetReqWarn = 1 /* After we know more about system, we'll warn folks */
end
end
else ReqT = 0
/* Use requester commands if they are available. */
if ~ReqT then
if exists('c:requestchoice') then do
/* Copy under new name so we can delete them later without **
** deleting a copy that user might have put into t: */
address command 'copy c:requestchoice t:rqchoice'
address command 'copy c:requestfile t:rqfile'
DReq = 1
end
if CheckLib('rexxarplib.library') then do
/* Set a default position */
if getclip('RASLpos') = '' then
call setclip('RASLpos', '20 50 354 300 #?')
RArp = 1
end
else RArp = 0
/* Tell user we've removed rexxreqtools.library */
if SetReqWarn = 1 then do
call InfoReq('ARexxGuide utilities', 'A minimum version of 37.50 is required\by ARexxGuide for rexxreqtools.library.\\The version on your system will not\be used.','OK')
end
call pragma('w', Null)
GoodAGPath = 0
CurAGPath = GetEnv('amigaguide/path')
do i = 1 to words(CurAGPath)
if exists(AddPathPart(word(CurAGPath,i), 'ARexxGuide.guide')) then do
GoodAGPath = 1
leave
end
end
call pragma('w')
if ~GoodAGPath then do CheckPath = 1
call InfoReq('Choose ARexxGuide directory.','Pick the directory where ARexxGuide\files were stored.','OK')
if ~exists(AddPathPart(ARxPath, 'ARexxGuide.guide')) | ARxPath = '' then do
if InfoReq('Problem with chosen path.','Sorry.\The file ARexxGuide.guide can''t be found\in' ARxPath'.\\It is one of the files in archive.\Try again?', 'BOOL') then
iterate
else
signal NOARXPATH
end
if find(upper(CurAGPath), upper(ARxPath)) = 0 then do
/* Check for file only when this var is not already set */
if AGCmd > '' then do
AGDir = ParseFileName(AGCmd, 'P')
AGProg = ParseFileName(AGCmd)
end
else do
call pragma('w', null) /* Turn off volume requesters */
if exists('SYS:Utilities') then
AGDir = 'SYS:Utilities'
else
AGDir = ''
if exists('SYS:Utilities/AmigaGuide') then
AGProg = 'AmigaGuide'
else
AGProg = 'Multiview'
call pragma('W') /* Turn requesters on again */
end
if (~exists(AGCmd) | AGCmd = '') then do
call InfoReq('Choose AmigaGuide utility', 'The program needs information about\the location of your AmigaGuide utility.\Please choose the program you use\to view AmigaGuide files.', 'OK')
CheckARxCmd = 1
end
else if abbrev(CallProg, 'GEN') then
if InfoReq('ARexxGuide help system','Would you like to change setting of\command variable?\\Current:\ 'AGCmd, 'BOOL') then
CheckARxCmd = 1
if CheckARxCmd = 1 then do
/* We have a default value, now ask for the real thing */
/* Launch prog. uses rexxarplib to open & control a pub screen */
if RArp then
if InfoReq('ARexxGuide public screen','Do you want ARexxGuide to open on\its own public screen?', 'BOOL') then
PubScr = 'ARX_GUIDE'
else
PubScr = 'WORKBENCH'
else PubScr = 'WORKBENCH'
call setenv('ARexxGuide/PubScr', PubScr)
end
if find('HELP GEN', CallProg) > 0 then do
/* Get paths for help key */
if InfoReq('Choose cross-ref files','Pick OK to add cross-ref files\from other guides to be loaded\with the help system.\\You will be able to choose from\multiple directories.\Pick from initial dir now.\\Directories will be added to\env:AmigaGuide/path.', 'CANCEL') then do
if ~abbrev(upper(readch(6CheckX, 12)), 'XREF:') then
iterate CheckX
end
end
XRfiles = XRfiles Xfile
end
end
/* Drop out if no files were chosen in the requester */
if MultiRq.0 = 0 then
XAddMore = 0
/* Add dir to path if it isn't there already */
else if find(upper(CurAGpath), upper(Xpath)) = 0 then do
SetAGpath = 1
CurAGpath = CurAGpath Xpath
end
end
end
call setenv('AmigaGuide/path', CurAGpath)
call setenv('ARexxGuide/XRFiles', XRfiles)
end
call close 'XRdisplay'
/* Should the fullhelp window be displayed? */
if Rarp then do
if InfoReq('ARexxGuide help system','Would you like to see a window with\information about the current clause\when help system doesn''t find a\match for chosen word?', 'BOOL') then
call setenv( 'ARexxGuide/ShowFullHelp', 1)
else
call setenv( 'ARexxGuide/ShowFullHelp', 0)
end
end
end
if find('REQPORT GEN', CallProg) > 0 & ReqT then do
if CallProg = 'GEN' then
call setenv('ARexxGuide/RqVer', 0)
if CallProg = 'GEN' then
if ~InfoReq('ARexxGuide help system','Are you using the RQ (Requester) version?', 'BOOL') then
break /* Don't want to do the rest of this stuff */
else
call setenv('ARexxGuide/RqVer', 1)
CurFont = getenv('arexxguide/reqfont')
if pos('/', CurFont) > 0 then do
if InfoReq('Glossary requesters', 'Do you wish to change the font\used with reqesters?\\Current:' CurFont,'BOOL') then
FontReq = 1
end
else if InfoReq('Glossary requesters', 'Do you wish to specify a font\to be used with the glossary\requesters?','BOOL') then
FontReq = 1
if FontReq = 1 then do
RqFont. = ''
call rtfontrequest('Choose font for requesters', ,,RqFont)